<template>
    <div class="cpn-top">
        <img src="https://www.iamwawa.cn/Public/img/logo@2x.png" alt="" />
        <h2 @click="add">蛙蛙工具</h2>
        <p>便携的在线工具网站</p>
    </div>
</template>

<script>
export default {
    props:['fathername'],
    data() {
        return {
            name:'222'
        };
    },
    methods: {
        add() {
            // this.$emit(我们在父组件中写到自定义方法，我们要传过去的值)
            this.$emit('getsondata',this.name)
        },
    },
};
</script>

<style scoped lang="scss">
.cpn-top {
    border: 1px solid red;
    text-align: center;
    h2 {
        color: #4caf50;
    }
    p {
        color: #666666;
    }
}
</style>
